package com.cellulam.framework.push;

import com.cellulam.framework.core.auth.UserClient;
import com.cellulam.framework.push.common.MailSender;
import com.cellulam.framework.push.mail.MailProperties;
import com.cellulam.framework.push.sms.SmsSender;
import com.cellulam.framework.push.smtp.SmtpMailer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class PushAutoConfiguration {

    @Autowired(required = false)
    private UserClient userClient;

    @Bean
    public SmsSender smsSender() {
        return new SmsSender(this.userClient);
    }

    @Bean
    public MailSender mailSender(MailProperties mailProperties) {
        return new SmtpMailer(mailProperties);
    }
}
